#ifndef MENU_H
#define MENU_H

#include "global.h"

typedef enum { SUBMENU, FUNCTION_CALL, BOOLEAN, DO_NOTHING, BACK,
	STRING, UINTEGER, NOT_IMPLEMENTED } MenuAction;

typedef struct {
	char* text;
	MenuAction action;
	void* data;
	void* data2;
	SDL_Rect r;
} OptionMenu;

typedef struct {
	int option;
	int n_options;
	SDL_Surface* sf;
	_Bool bw;
	TTF_Font *font;
	OptionMenu* current_menu;
	_Bool editing_text;
	char* tmp_editing;
} Menu;

Menu* create_menu(OptionMenu* om, TTF_Font *font, _Bool bw);
_Bool process_menu(Menu* m, SDL_Event* e, int menu_x, int menu_y);
void free_menu(Menu* m);

#endif
